package zaphod.toy.gef.japanexample.editors;

import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.gef.DefaultEditDomain;
import org.eclipse.gef.GraphicalViewer;
import org.eclipse.gef.ui.parts.GraphicalEditor;

import zaphod.toy.gef.japanexample.model.HelloModel;
import zaphod.toy.gef.japanexample.model.MyEditPartFactory;


public class HelloWorldEditor extends GraphicalEditor
{

    public HelloWorldEditor()
    {
        setEditDomain( new DefaultEditDomain( this ) );
    }


    @Override
    protected void initializeGraphicalViewer()
    {
        GraphicalViewer viewer = getGraphicalViewer();
        HelloModel model = new HelloModel();
        viewer.setContents( model );
    }


    @Override
    public void doSave( IProgressMonitor monitor )
    {
        // TODO Auto-generated method stub

    }


    @Override
    protected void configureGraphicalViewer()
    {
        super.configureGraphicalViewer();

        GraphicalViewer viewer = getGraphicalViewer();
        viewer.setEditPartFactory( new MyEditPartFactory() );
    }

}
